Repository navigation
fix(aggregator): pair-safe caps for event-log writers (#7740) - #8114
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Codex findings disposition (task 14514, lane code-t): the Codex code review on this PR failed to run — the connector reported Codex usage limits reached, and no review findings were posted (review-comment list is empty). There is therefore no substantive Codex finding to fix or rebut on this PR; the failed-review state is a quota failure, not a code finding. Merge remains gated on CI green. |
Fixes #7740.
What
The event log's writers capped
actor/summarywith raw UTF-16.slice()at exactly the lengthsvalidateStreamEventenforces (200/500). An astral character straddling a cap was split, the length-only validator passed it, and a lone high surrogate was persisted into the append-only, hash-chained event log.pm-stack/aggregator/src/sources/live.ts: pair-safecapUnits(the aggregator(actions): cleanText caps can split a surrogate pair — a stored action field ends in a lone surrogate #7694-family guard) at the three writer sites — session-registry event, orchestration action event, tier-change event.pm-stack/aggregator/src/server.ts: pair-safecapUnitsat the two action-result writer sites — thebyRunactor fallback (200) and the constructed summary (500).pm-stack/aggregator/src/events.ts: boundary guard invalidateStreamEvent— a trailing lone high surrogate inactor/summaryis dropped before the value is stored, so no present or future writer can persist one into the hash chain.Tests
New
pm-stack/aggregator/test/events-surrogate-7740.test.ts(oracle: a stored event field never ends in a lone high surrogate and always round-trips through UTF-8 unchanged):events.tsguard stashed);EventsStore.recordof writer-shaped events persists no\ud83din the on-disk file and the hash chain verifies (health().integrity.ok).Existing suites:
events.test.ts+events-archive-3322.test.tspass (57 tests with the new file).bunx tsc --noEmitshows 8 pre-existing errors, none in the touched files.Queue: task 14514, lane code-y.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.